//
//  StickerDataManager.h
//  BaiTengIM
//
//  Created by awh on 2019/9/16.
//  Copyright © 2019 awh. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
@class StickerModel;

#pragma mark - PPStickerMatchingResult

@interface PPStickerMatchingResult : NSObject
@property (nonatomic, assign) NSRange range;                    // 匹配到的表情包文本的range
@property (nonatomic, strong) UIImage *image;              // 如果能在本地找到emoji的图片，则此值不为空
@property (nonatomic, strong) NSString *desc;     // 表情的实际文本(形如：[哈哈])，不为空
@end



@interface StickerDataManager : NSObject

+ (instancetype)sharedInstance;

/// 所有的表情包
@property (nonatomic, strong, readonly) NSArray<StickerModel *> *allStickers;

/* 匹配给定attributedString中的所有emoji，如果匹配到的emoji有本地图片的话会直接换成本地的图片
 *
 * @param attributedString 可能包含表情包的attributedString
 * @param font 表情图片的对齐字体大小
 */
- (void)replaceEmojiForAttributedString:(NSMutableAttributedString *)attributedString font:(UIFont *)font;

- (NSArray<PPStickerMatchingResult *> *)matchingEmojiForString:(NSString *)string;


@end

NS_ASSUME_NONNULL_END
